<!DOCTYPE html>



  


<html class="theme-next pisces use-motion" lang="">
<head>
  <meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>
<meta name="theme-color" content="#222">









<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
















  
  
  <link href="/blog/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css" />







<link href="/blog/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css" />

<link href="/blog/css/main.css?v=5.1.4" rel="stylesheet" type="text/css" />


  <link rel="apple-touch-icon" sizes="180x180" href="/blog/images/apple-touch-icon-next.png?v=5.1.4">


  <link rel="icon" type="image/png" sizes="32x32" href="/blog/images/favicon-32x32-next.png?v=5.1.4">


  <link rel="icon" type="image/png" sizes="16x16" href="/blog/images/favicon-16x16-next.png?v=5.1.4">


  <link rel="mask-icon" href="/blog/images/logo.svg?v=5.1.4" color="#222">





  <meta name="keywords" content="Hexo, NexT" />










<meta name="description" content="软件版本：Eclipse：eclipse-jee-neon-3-win32-x86_64JDK: 1.8Openfire: 4.1.5  下载源码">
<meta name="keywords" content="Android、iOS、Web、React Native">
<meta property="og:type" content="article">
<meta property="og:title" content="Eclipse-运行Openfire源码(Windows)">
<meta property="og:url" content="http://yoursite.com/blog/2018/08/06/IM/Eclipse-运行Openfire源码(Windows)/index.html">
<meta property="og:site_name" content="凌浩雨_博客">
<meta property="og:description" content="软件版本：Eclipse：eclipse-jee-neon-3-win32-x86_64JDK: 1.8Openfire: 4.1.5  下载源码">
<meta property="og:locale" content="default">
<meta property="og:image" content="http://upload-images.jianshu.io/upload_images/3110861-fd2083d1c49e893f.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240">
<meta property="og:image" content="http://upload-images.jianshu.io/upload_images/3110861-07fa9301e0ac0f4e.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240">
<meta property="og:image" content="http://upload-images.jianshu.io/upload_images/3110861-d4935b373477cf5c.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240">
<meta property="og:image" content="http://upload-images.jianshu.io/upload_images/3110861-478f842ffc518da6.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240">
<meta property="og:image" content="http://upload-images.jianshu.io/upload_images/3110861-45e5f58597c46fcc.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240">
<meta property="og:image" content="http://upload-images.jianshu.io/upload_images/3110861-6103fbf97fdef1b7.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240">
<meta property="og:image" content="http://upload-images.jianshu.io/upload_images/3110861-e8a5e375038483c2.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240">
<meta property="og:image" content="http://upload-images.jianshu.io/upload_images/3110861-bd2c38c5b3db9583.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240">
<meta property="og:image" content="http://upload-images.jianshu.io/upload_images/3110861-5e0e3b3ab4c67f44.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240">
<meta property="og:image" content="http://upload-images.jianshu.io/upload_images/3110861-960c22ace0cc39cf.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240">
<meta property="og:image" content="http://upload-images.jianshu.io/upload_images/3110861-0d5a4593c42a5666.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240">
<meta property="og:image" content="http://upload-images.jianshu.io/upload_images/3110861-6a6e6e2b6c1efa8d.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240">
<meta property="og:image" content="http://upload-images.jianshu.io/upload_images/3110861-f5e32378889afe09.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240">
<meta property="og:image" content="http://upload-images.jianshu.io/upload_images/3110861-9b4c02ae76522cba.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240">
<meta property="og:image" content="http://upload-images.jianshu.io/upload_images/3110861-66c1ecab0a004215.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240">
<meta property="og:image" content="http://upload-images.jianshu.io/upload_images/3110861-05b5236d99392464.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240">
<meta property="og:image" content="http://upload-images.jianshu.io/upload_images/3110861-ff3080f89d2a83d6.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240">
<meta property="og:image" content="http://upload-images.jianshu.io/upload_images/3110861-e504039f20deb2a0.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240">
<meta property="og:image" content="http://upload-images.jianshu.io/upload_images/3110861-cf520c3602286250.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240">
<meta property="og:image" content="http://upload-images.jianshu.io/upload_images/3110861-d240aca78920c439.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240">
<meta property="og:updated_time" content="2018-08-06T11:02:31.692Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="Eclipse-运行Openfire源码(Windows)">
<meta name="twitter:description" content="软件版本：Eclipse：eclipse-jee-neon-3-win32-x86_64JDK: 1.8Openfire: 4.1.5  下载源码">
<meta name="twitter:image" content="http://upload-images.jianshu.io/upload_images/3110861-fd2083d1c49e893f.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240">



<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/blog/',
    scheme: 'Pisces',
    version: '5.1.4',
    sidebar: {"position":"left","display":"post","offset":12,"b2t":false,"scrollpercent":false,"onmobile":false},
    fancybox: true,
    tabs: true,
    motion: {"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},
    duoshuo: {
      userId: '0',
      author: 'Author'
    },
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>



  <link rel="canonical" href="http://yoursite.com/blog/2018/08/06/IM/Eclipse-运行Openfire源码(Windows)/"/>





  <title>Eclipse-运行Openfire源码(Windows) | 凌浩雨_博客</title>
  








</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="default">

  
  
    
  

  <div class="container sidebar-position-left page-post-detail">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta ">
    

    <div class="custom-logo-site-title">
      <a href="/blog/"  class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">凌浩雨_博客</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
      
        <p class="site-subtitle"></p>
      
  </div>

  <div class="site-nav-toggle">
    <button>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/blog/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br />
            
            Home
          </a>
        </li>
      
        
        <li class="menu-item menu-item-archives">
          <a href="/blog/archives/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-archive"></i> <br />
            
            Archives
          </a>
        </li>
      

      
    </ul>
  

  
</nav>



 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  

  
  
  

  <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="http://yoursite.com/blog/blog/2018/08/06/IM/Eclipse-运行Openfire源码(Windows)/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="凌浩雨">
      <meta itemprop="description" content="">
      <meta itemprop="image" content="/blog/images/avatar.jpeg">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="凌浩雨_博客">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">Eclipse-运行Openfire源码(Windows)</h1>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">Posted on</span>
              
              <time title="Post created" itemprop="dateCreated datePublished" datetime="2018-08-06T18:01:38+08:00">
                2018-08-06
              </time>
            

            

            
          </span>

          

          
            
          

          
          

          

          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        <p>软件版本：<br>Eclipse：eclipse-jee-neon-3-win32-x86_64<br>JDK: 1.8<br>Openfire: 4.1.5</p>
<ol>
<li>下载<a href="http://www.igniterealtime.org/downloads/source.jsp" target="_blank" rel="noopener">源码</a></li>
</ol>
<p><img src="http://upload-images.jianshu.io/upload_images/3110861-fd2083d1c49e893f.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240" alt="图1.png"></p>
<a id="more"></a>
<p>选择openfire_src_4_1_5.zip下载</p>
<ol start="2">
<li>配置Eclipse项目。把下载好的 openfire_src_4_1_5.zip 压缩包直接解压到Eclipse的工作目录（E:\eclipse\openfire），结构如下：</li>
</ol>
<p><img src="http://upload-images.jianshu.io/upload_images/3110861-07fa9301e0ac0f4e.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240" alt="图2.png"></p>
<ol start="3">
<li>打开openfire_src，目录如下</li>
</ol>
<p><img src="http://upload-images.jianshu.io/upload_images/3110861-d4935b373477cf5c.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240" alt="图3.png"><br>将图中的三个html文件删除。</p>
<ol start="4">
<li>把openfire_src/build/eclipse/下的三个文件夹复制到openfire_src/目录下。</li>
</ol>
<p><img src="http://upload-images.jianshu.io/upload_images/3110861-478f842ffc518da6.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240" alt="图4.png"></p>
<p><img src="http://upload-images.jianshu.io/upload_images/3110861-45e5f58597c46fcc.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240" alt="图5.png"></p>
<ol start="5">
<li>把openfire_src目录下的classpth文件、project文件、settings文件夹修改成Eclipse工程配置文件格式，重命名为在每个原有的名字上加上一个点，即.classpth、.project、.settings。如下图所示：</li>
</ol>
<p><img src="http://upload-images.jianshu.io/upload_images/3110861-6103fbf97fdef1b7.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240" alt="图6.png"><br>    <strong>注意：在windows下面不能直接重命名，需要在dos下面操作，即进入相应的目录执行rename classpth .classpth即可，其它两个文件执行一样的操作。</strong></p>
<p><img src="http://upload-images.jianshu.io/upload_images/3110861-e8a5e375038483c2.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240" alt="图7.png"></p>
<ol start="6">
<li>打开Eclipse，选择 File –&gt; Import… –&gt; Existing Projects into Workspace  选择E:\eclipse\openfire\openfire_src 导入即可</li>
</ol>
<p><img src="http://upload-images.jianshu.io/upload_images/3110861-bd2c38c5b3db9583.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240" alt="图8.png"></p>
<ol start="7">
<li>导入后目录结构如下(因源文件夹太多，截图无法截全)</li>
</ol>
<p><img src="http://upload-images.jianshu.io/upload_images/3110861-5e0e3b3ab4c67f44.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240" alt="图9.png"></p>
<ol start="8">
<li>使用ANT进行工程的编译。Eclipse中Window-&gt;Show View-&gt;Ant，显示出Ant窗口，单击右键，在弹出的快捷菜单中选择Add Buildfiles，在弹出的对话框中，展开openfire/build文件夹，选择build目录下的build.xml，点击OK，接下来在Ant视图中将Openfire XMPP Server右键选择Run As-&gt;Ant Build，等待片刻，在控制台中显示“BUILD SUCCESSFUL” 那么就表示编译成功。</li>
</ol>
<p><img src="http://upload-images.jianshu.io/upload_images/3110861-960c22ace0cc39cf.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240" alt="图10.png"></p>
<p><img src="http://upload-images.jianshu.io/upload_images/3110861-0d5a4593c42a5666.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240" alt="图11.png"></p>
<ol start="9">
<li>设置启动项目。点击openfire项目，在菜单栏中选择Run-&gt;Run Configurations弹出一个对话框，在左侧菜单中右键点击Java Application，选择New创建启动配置。</li>
</ol>
<p><img src="http://upload-images.jianshu.io/upload_images/3110861-6a6e6e2b6c1efa8d.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240" alt="图12.png"></p>
<ol start="10">
<li>其中 Name随便设置，Main class设置为”org.jivesoftware.openfire.starter.ServerStarter”,点击应用。</li>
</ol>
<p><img src="http://upload-images.jianshu.io/upload_images/3110861-f5e32378889afe09.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240" alt="图13.png"></p>
<ol start="11">
<li>点击进入Arguments选项卡，在上面那个框（VM arguments：）中填写<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">-DopenfireHome=&quot;$&#123;workspace_loc:openfire&#125;/target/openfire&quot;</span><br></pre></td></tr></table></figure>
</li>
</ol>
<p>其中${workspace_loc:openfire} 中的 openfire要根据你的项目名来进行同步修改,点击Apply应用。</p>
<p><img src="http://upload-images.jianshu.io/upload_images/3110861-9b4c02ae76522cba.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240" alt="图14.png"></p>
<ol start="12">
<li>点击进入Classpath选项卡，选中User Entries，然后点击右侧的Advanced按钮，会弹出一个小框，选择Add Folders，单击OK。<br>选择 openfire\src\i18n点OK 按钮将这个文件夹加入到Classpath选项卡中<br>选择 openfire\src\resources 目录也加到 Classpath选项卡中<br>点击Apply应用。</li>
</ol>
<p><img src="http://upload-images.jianshu.io/upload_images/3110861-66c1ecab0a004215.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240" alt="图15.png"></p>
<p><img src="http://upload-images.jianshu.io/upload_images/3110861-05b5236d99392464.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240" alt="图16.png"></p>
<ol start="13">
<li>点击进入Common选项卡中，勾选Run复选框，点击Apply应用。</li>
</ol>
<p><img src="http://upload-images.jianshu.io/upload_images/3110861-ff3080f89d2a83d6.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240" alt="图17.png"></p>
<ol start="14">
<li>点击Run运行。 程序正常运行结果如下。</li>
</ol>
<p><img src="http://upload-images.jianshu.io/upload_images/3110861-e504039f20deb2a0.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240" alt="图18.png"></p>
<ol start="15">
<li>在浏览器中输入<a href="http://127.0.0.1:9090/" target="_blank" rel="noopener">http://127.0.0.1:9090</a>运行后显示结果如下</li>
</ol>
<p><img src="http://upload-images.jianshu.io/upload_images/3110861-cf520c3602286250.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240" alt="图19.png"></p>
<ol start="16">
<li>这是由文件路径所导致的，解决方法: 点击进入Classpath选项卡，选中User Entries，然后点击右侧的Advanced按钮，会弹出一个小框，选择Add Folders，单击OK。<br>选择 openfire\src\resources\jar 目录也加到 Classpath选项卡中<br>点击Apply应用。</li>
</ol>
<p><img src="http://upload-images.jianshu.io/upload_images/3110861-d240aca78920c439.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240" alt="图20.png"></p>

      
    </div>
    
    
    

    

    

    

    <footer class="post-footer">
      

      
      
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/blog/2018/08/06/IM/Android-Smack_4_2_0-jar-使用/" rel="next" title="Android-Smack_4_2_0-jar-使用">
                <i class="fa fa-chevron-left"></i> Android-Smack_4_2_0-jar-使用
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/blog/2018/08/06/IM/Openfire及Spark配置(Mac)/" rel="prev" title="Openfire及Spark配置(Mac)">
                Openfire及Spark配置(Mac) <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </div>
  
  
  
  </article>



    <div class="post-spread">
      
    </div>
  </div>


          </div>
          


          

  



        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    
    <div class="sidebar-inner">

      

      

      <section class="site-overview-wrap sidebar-panel sidebar-panel-active">
        <div class="site-overview">
          <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
            
              <img class="site-author-image" itemprop="image"
                src="/blog/images/avatar.jpeg"
                alt="凌浩雨" />
            
              <p class="site-author-name" itemprop="name">凌浩雨</p>
              <p class="site-description motion-element" itemprop="description">专业从事于移动端开发，Android与iOS均有涉及，主做Android开发与React Native开发</p>
          </div>

          <nav class="site-state motion-element">

            
              <div class="site-state-item site-state-posts">
              
                <a href="/blog/archives/">
              
                  <span class="site-state-item-count">393</span>
                  <span class="site-state-item-name">posts</span>
                </a>
              </div>
            

            

            

          </nav>

          

          

          
          

          
          

          

        </div>
      </section>

      

      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright">&copy; <span itemprop="copyrightYear">2018</span>
  <span class="with-love">
    <i class="fa fa-user"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">凌浩雨</span>

  
</div>


  <div class="powered-by">Powered by <a class="theme-link" target="_blank" href="https://hexo.io">Hexo</a></div>



  <span class="post-meta-divider">|</span>



  <div class="theme-info">Theme &mdash; <a class="theme-link" target="_blank" href="https://github.com/iissnan/hexo-theme-next">NexT.Pisces</a> v5.1.4</div>




        







        
      </div>
    </footer>

    
      <div class="back-to-top">
        <i class="fa fa-arrow-up"></i>
        
      </div>
    

    

  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  












  
  
    <script type="text/javascript" src="/blog/lib/jquery/index.js?v=2.1.3"></script>
  

  
  
    <script type="text/javascript" src="/blog/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>
  

  
  
    <script type="text/javascript" src="/blog/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>
  

  
  
    <script type="text/javascript" src="/blog/lib/velocity/velocity.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/blog/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/blog/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>
  


  


  <script type="text/javascript" src="/blog/js/src/utils.js?v=5.1.4"></script>

  <script type="text/javascript" src="/blog/js/src/motion.js?v=5.1.4"></script>



  
  


  <script type="text/javascript" src="/blog/js/src/affix.js?v=5.1.4"></script>

  <script type="text/javascript" src="/blog/js/src/schemes/pisces.js?v=5.1.4"></script>



  
  <script type="text/javascript" src="/blog/js/src/scrollspy.js?v=5.1.4"></script>
<script type="text/javascript" src="/blog/js/src/post-details.js?v=5.1.4"></script>



  


  <script type="text/javascript" src="/blog/js/src/bootstrap.js?v=5.1.4"></script>



  


  




	





  





  












  





  

  

  

  
  

  

  

  

</body>
</html>
